package org.phalanx.server.net;

import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Message;
import org.phalanx.server.PhalanxServer;

/*
 * Author Steven Day
 * 
 * Message Handler will be the gateway listener.
 * 
 * */

public class EchoClass extends Thread implements MessageListener {
	Chat thisChat;
	Message thisMsg;
	
	public void processMessage(Chat arg0, Message arg1) {
		this.thisChat = arg0;
		this.thisMsg = arg1;
		start();
	}

	@Override
	public void run() {
		try {
			Thread.sleep(100);
			thisChat.sendMessage("Echo");
		} catch (XMPPException xe){
			xe.printStackTrace();
		} catch (InterruptedException ie){
			ie.printStackTrace();
		}
	}
	
	

}
